﻿@model SAIM.Models.GetEditionsByCommentViewModel
@using SAIM.Models

<div class="modal-dialog modal-lg">
    <!-- Modal content-->
    <div class="modal-content" style="overflow-y: auto; margin-top: 10%;">
        <div class="modal-header">
            <h4 class="text-primary"><span class="glyphicon glyphicon-time"></span> Historial de comentarios</h4>
        </div>
        <div class="modal-body">
            <ul class="list-group">
                @if (Model.Comments.Count > 0)
                {
                    <li class="list-group-item list-group-item-info">
                        <form class="form-horizontal">
                            <div class="form-group">
                                <div class="col-sm-12">
                                    <h4 class="list-group-item-heading">@Model.ParentComment.UserName</h4>
                                    <h5 class="list-group-item-heading">@Model.ParentComment.CommentDate</h5>
                                    @if (Model.ParentComment.IsPrivate)
                                    {
                                        <h5 class="list-group-item-heading">
                                            <span class="label label-primary">
                                                <span class="glyphicon glyphicon-user" aria-hidden="true"></span>
                                            </span>
                                            Comentario Administrativo
                                        </h5>
                                    }
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="comment-area col-sm-12">
                                    <p class="list-group-item-text">@MvcHtmlString.Create(@Model.ParentComment.Comment.Replace(Environment.NewLine, "<br />"))</p>
                                </div>
                            </div>
                        </form>
                    </li>
                    foreach (TicketComment element in Model.Comments)
                    {
                        <li class="list-group-item">
                            <form class="form-horizontal">
                                <div class="form-group">
                                    <div class="col-sm-12">
                                        <h4 class="list-group-item-heading">@element.UserName</h4>
                                        <h5 class="list-group-item-heading">@element.CommentDate</h5>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <div class="comment-area col-sm-12">
                                        <p class="list-group-item-text">@MvcHtmlString.Create(element.Comment.Replace(Environment.NewLine, "<br />"))</p>
                                    </div>
                                </div>
                            </form>
                        </li>
                    }
                }
                else
                {
                    <div class="alert alert-info" role="alert">Este comentario no contiene ediciones.</div>
                }
            </ul>
        </div>
        <div class="modal-footer">
            <button type="button" class="btn btn-danger btn-default pull-left" data-dismiss="modal"><span class="glyphicon glyphicon-remove"></span> Cerrar</button>
        </div>
    </div>
</div>
